package entry;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/***
 *  服务端：多线程接收数据
 */
public class ServerTcp {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(12345);

        while (true){
            // 监听端口获取连接对象
            Socket s = ss.accept();

            //  开启线程为每一个连接对象进行业务处理
            new Thread(new ServerThread(s)).start();
        }
    }
}
